package day240417.work;

import java.util.Scanner;

public class StringConcat {
//    public String concat(String a,String b){
//        return a+"-="+b;
//两个字符串拼接
//    }
    Scanner scanner=new Scanner(System.in);
    String msg =scanner.next();
//加入用户输入，把拼接符号让用户自己选择
   public String concat(String... words) {
       String result = "";
       for (int i = 0; i < words.length; i++) {
//result=result+word[i]等价于result+=word[i];
           result += words[i] + ((i == words.length - 1) ? "" : msg);
       }
       return result;
   }
//    支持多个不定长度的字符串拼接
}
